package com.shankungfu.view;

import com.shankungfu.MainApplication;
import com.shankungfu.R;

import android.app.Dialog;
import android.content.Context;
import android.os.Bundle;
import android.view.Window;
import android.view.WindowManager.LayoutParams;

public class MyDialog extends Dialog {

	public MyDialog(Context context, boolean cancelable,
			OnCancelListener cancelListener) {
		super(context, cancelable, cancelListener);
	}

	public MyDialog(Context context, int theme) {
		super(context, theme);
	}

	public MyDialog(Context context) {
		super(context);
	}
	
	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		requestWindowFeature(Window.FEATURE_NO_TITLE);
		setContentView(R.layout.my_dialog_layout);
		initWindow();
	}
	
	private void initWindow() {
        LayoutParams p = getWindow().getAttributes();
        p.height = (int) (MainApplication.screenHight * 1);
        p.width = (int) (MainApplication.screenWidth * 1);
        p.alpha = 1f;
        getWindow().setAttributes(p);
    }

}
